Skip to content

Add SCTPDBG statement for connections closing.#707

Open
JonathanLennox wants to merge 2 commits intosctplab:masterfrom
JonathanLennox:debug-connection-closing
Open

Add SCTPDBG statement for connections closing.#707
JonathanLennox wants to merge 2 commits intosctplab:masterfrom
JonathanLennox:debug-connection-closing

Conversation

@JonathanLennox
Copy link
Copy Markdown
Contributor

This reuses the existing sctp_log_closing mechanism.

@JonathanLennox
Copy link
Copy Markdown
Contributor Author

I picked an unused SCTP_DEBUG constant for this; if there's a better value I should use please let me know.

This reuses the existing sctp_log_closing mechanism.
@JonathanLennox JonathanLennox force-pushed the debug-connection-closing branch from f7dc99e to 85aa089 Compare April 15, 2024 19:18
Comment thread usrsctplib/netinet/sctputil.h Outdated
void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc);

#ifdef SCTP_DEBUG
#define SCTP_LOG_CLOSING 1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCTP_LOG_CLOSING should be defined via the build system. Since you use it for debugging, maybe something like
env CFLAGS=-DSCTP_LOG_CLOSING ./configure
is good enough?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to put the new log statement in a single place, and the existing sctp_log_closing function was only called if the SCTP_LOG_CLOSING define is set.

Currently (prior to my patch), sctp_log_closing only does something if SCTP_LOCAL_TRACE_BUF is set.

With my latest commit, the behavior (other than the addition of the new debug message) should be the same as it was previously for all compiler flags.

Instead, conditionalize its call to SCTP_CTR6 on SCTP_LOG_CLOSING.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants